<% layout('/layouts/default.html', {title: '员工信息表管理', libs: ['dataGrid']}){ %>
<div class="main-content">
    <div class="box box-main">
        <div class="box-header">
            <div class="box-title">
                <i class="fa icon-notebook"></i> ${text('员工信息表管理')}
            </div>
            <div class="box-tools pull-right">
                <a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
                <% if(hasPermi('dept:employees:edit')){ %>
                <a href="${ctx}/dept/employees/form" class="btn btn-default btnTool" title="${text('新增员工信息表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
                <% } %>
                <a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
            </div>
        </div>
        <div class="box-body">
            <#form:form id="searchForm" model="${employees}" action="${ctx}/dept/employees/listByNameData" method="post" class="form-inline hide"
            data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
            <div class="form-group">
                <label class="control-label">${text('员工姓名')}：</label>
                <div class="control-inline">
                    <#form:input path="name" maxlength="50" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工籍贯')}：</label>
                <div class="control-inline">
                    <#form:input path="nativePlace" maxlength="100" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工工作内容')}：</label>
                <div class="control-inline">
                    <#form:input path="workContent" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工全年工作时间')}：</label>
                <div class="control-inline">
                    <#form:input path="annualWorkHours" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工来单位开始日期')}：</label>
                <div class="control-inline">
                    <#form:input path="startDate" readonly="true" maxlength="20" class="form-control laydate width-datetime"
                    dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工来单位结束日期')}：</label>
                <div class="control-inline">
                    <#form:input path="endDate" readonly="true" maxlength="20" class="form-control laydate width-datetime"
                    dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工所在地区')}：</label>
                <div class="control-inline">
                    <#form:input path="location" maxlength="100" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工业余爱好')}：</label>
                <div class="control-inline width-120">
                    <#form:select path="hobby" dictType="emp_hobby" multiple="true" blankOption="true" class="form-control"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工表现')}：</label>
                <div class="control-inline width-120">
                    <#form:select path="performance" dictType="emp_show" blankOption="true" class="form-control"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工政绩成绩分数')}：</label>
                <div class="control-inline">
                    <#form:input path="achievementScore" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工所属单位')}：</label>
                <div class="control-inline">
                    <#form:input path="affiliatedUnit" maxlength="100" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工状态')}：</label>
                <div class="control-inline width-120">
                    <#form:select path="empStatus" dictType="emp_status" blankOption="true" class="form-control"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('创建者')}：</label>
                <div class="control-inline">
                    <#form:input path="creator" maxlength="50" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('创建时间')}：</label>
                <div class="control-inline">
                    <#form:input path="createTime" readonly="true" maxlength="20" class="form-control laydate width-datetime"
                    dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('更新者')}：</label>
                <div class="control-inline">
                    <#form:input path="updater" maxlength="50" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('更新时间')}：</label>
                <div class="control-inline">
                    <#form:input path="updateTime" readonly="true" maxlength="20" class="form-control laydate width-datetime"
                    dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('备注信息')}：</label>
                <div class="control-inline">
                    <#form:input path="remarks" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工附件')}：</label>
                <div class="control-inline">
                    <#form:input path="resume" maxlength="255" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('员工头像')}：</label>
                <div class="control-inline">
                    <#form:input path="avatar" maxlength="255" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
                <button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
            </div>
        </#form:form>
        <table id="dataGrid"></table>
        <div id="dataGridPage"></div>
    </div>
</div>
</div>
<% } %>
<script>
    console.log("--555555555555555555555555555555555555555555555--");
    // 初始化DataGrid对象
    $('#dataGrid').dataGrid({
        searchForm: $("#searchForm"),

        columnModel: [

            {header:'${text("员工姓名")}', name:'name', index:'a.name', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
                    return '<a href="${ctx}/dept/employees/form?id='+row.id+'" class="btnList" data-title="${text("编辑员工信息表")}">'+(val||row.id)+'</a>';
                }},
            {header:'${text("员工籍贯")}', name:'nativePlace', index:'a.native_place', width:150, align:"left"},
            {header:'${text("员工工作内容")}', name:'workContent', index:'a.work_content', width:150, align:"left"},
            {header:'${text("员工全年工作时间")}', name:'annualWorkHours', index:'a.annual_work_hours', width:150, align:"center"},
            {header:'${text("员工来单位开始日期")}', name:'startDate', index:'a.start_date', width:150, align:"center"},
            {header:'${text("员工来单位结束日期")}', name:'endDate', index:'a.end_date', width:150, align:"center"},
            {header:'${text("员工所在地区")}', name:'location', index:'a.location', width:150, align:"left"},
            {header:'${text("员工业余爱好")}', name:'hobby', index:'a.hobby', width:150, align:"center", formatter: function(val, obj, row, act){
                    return js.getDictLabel(${@DictUtils.getDictListJson('emp_hobby')}, val, '${text("未知")}', true);
                }},
            {header:'${text("员工表现")}', name:'performance', index:'a.performance', width:150, align:"center", formatter: function(val, obj, row, act){
                    return js.getDictLabel(${@DictUtils.getDictListJson('emp_show')}, val, '${text("未知")}', true);
                }},
            {header:'${text("员工政绩成绩分数")}', name:'achievementScore', index:'a.achievement_score', width:150, align:"center"},
            {header:'${text("员工所属单位")}', name:'affiliatedUnit', index:'a.affiliated_unit', width:150, align:"left"},
            {header:'${text("员工状态")}', name:'empStatus', index:'a.emp_status', width:150, align:"center", formatter: function(val, obj, row, act){
                    return js.getDictLabel(${@DictUtils.getDictListJson('emp_status')}, val, '${text("未知")}', true);
                }},
            {header:'${text("创建者")}', name:'creator', index:'a.creator', width:150, align:"left"},
            {header:'${text("创建时间")}', name:'createTime', index:'a.create_time', width:150, align:"center"},
            {header:'${text("更新者")}', name:'updater', index:'a.updater', width:150, align:"left"},
            {header:'${text("更新时间")}', name:'updateTime', index:'a.update_time', width:150, align:"center"},
            {header:'${text("备注信息")}', name:'remarks', index:'a.remarks', width:150, align:"left"},
            {header:'${text("员工附件")}', name:'resume', index:'a.resume', width:150, align:"left"},
            {header:'${text("员工头像")}', name:'avatar', index:'a.avatar', width:150, align:"left"},
            {header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
                    var actions = [];
                    //<% if(hasPermi('dept:employees:edit')){ %>
                    actions.push('<a href="${ctx}/dept/employees/form?id='+row.id+'" class="btnList" title="${text("编辑员工信息表")}"><i class="fa fa-pencil"></i></a>&nbsp;');
                    actions.push('<a href="${ctx}/dept/employees/delete?id='+row.id+'" class="btnList" title="${text("删除员工信息表")}" data-confirm="${text("确认要删除该员工信息表吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
                    //<% } %>
                    return actions.join('');
                }}
        ],
        // 加载成功后执行事件
        ajaxSuccess: function(data){

        }

    });
</script>